//package com.joyintech.config;
//
//import cn.hutool.core.util.ObjectUtil;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
//import org.springframework.kafka.config.KafkaListenerContainerFactory;
//import org.springframework.kafka.core.*;
//import org.springframework.kafka.listener.ConcurrentMessageListenerContainer;
//
//import java.util.Map;
//
///**
// * Kafka配置类
// *
// * @author 付聪
// * @time 2024-08-11 14:54:13
// */
//@Configuration
//public class KafkaConfig {
//
//
//
//    // ———————————————— 生产者相关（开始） ————————————————
//    @Primary
//    @Bean(name = "kafkaTemplate")
//    public KafkaTemplate kafkaTemplate(@Autowired @Qualifier("firstDataSourceKafkaProperties") KafkaProperties kafkaProperties) {
//        return new KafkaTemplate(this.getProducerFactory(kafkaProperties));
//    }
//
//    private ProducerFactory<String, String> getProducerFactory(KafkaProperties kafkaProperties) {
//
//        return new DefaultKafkaProducerFactory<>(this.getProducerConfigs(kafkaProperties));
//    }
//
//
//    private Map<String, Object> getProducerConfigs(KafkaProperties kafkaProperties) {
//        return kafkaProperties.buildProducerProperties();
//    }
//
//
//}
//
